package com.ruoyi.invoice.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.invoice.domain.InvoiceProducts;
import com.ruoyi.invoice.domain.SalesInvoiceDetail;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @BelongsProject: RuoYi-Cloud-master
 * @BelongsPackage: com.ruoyi.invoice.dto
 * @Author: songYuHang
 * @CreateTime: 2025-03-08  10:54
 * @Description: TODO
 * @Version: 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SalesInvoiceProductsDTO {

    private Long salesInvoiceId;

    @NotNull(message = "发票类型ID不能为空")
    private Long invoiceTypeId;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "开票日期不能为空")
    private Date billingDate;

    // 发票号码
    private String invoiceCode;

    // 发票号码
    private String invoiceNumber;

    // 全电发票代码
    private String fullElectricInvoiceNumber;


    private Integer isCancelled;

    // 客户id
    @NotNull(message = "客户ID不能为空")
    private Long customerId;

    @NotBlank(message = "地址不能为空")
    private String address;

    @NotBlank(message = "电话不能为空")
    private String phoneNumber;

    @NotBlank(message = "开户银行不能为空")
    private String bankName;

    @NotBlank(message = "账号不能为空")
    private String accountNumber;
    private String chassisNumber;
    private String machineCode;
    private String taxAuthorityCode;

    @NotNull(message = "认证状态不能为空")
    private Integer authenticationStatus;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date authenticationDate;

    @NotBlank(message = "备注不能为空")
    private String remarks;

    @NotNull(message = "业务类型ID不能为空")
    private Long businessTypeId;

    @NotNull(message = "模板ID不能为空")
    private Long templateId;

    @NotNull(message = "是否录入明细不能为空")
    private Integer isDetailEntered;

    @NotNull(message = "税价合计不能为空")
    private BigDecimal taxExcludedAmount;

    @NotNull(message = "税额不能为空")
    private BigDecimal taxAmount;

    @NotNull(message = "价税合计不能为空")
    private BigDecimal totalAmount;

    private List<InvoiceProducts> details;

}
